/**
 * 信息提示版
 */
(function(window, document) {
    "use strict"

    var that;
    function MessageBoard(dom) {
        this.dom = dom;
        that = this;
    }
    MessageBoard.prototype.init = function(size, minsize) {
        that.dom.className = "message-board";
        that.dom.style.cssText += ";min-width:"+minsize+"px;width:"+size+";";
        var bdTitile = document.createElement("div");
        bdTitile.className = "message-board-title";
        var titHeight = Math.ceil(minsize / 7);  // 用宽度最小值确定标题栏高度
        bdTitile.style.cssText += ";height:"+titHeight+"px;line-height:"+titHeight+"px;";
        that.bdTitile = bdTitile;
        that.dom.appendChild(bdTitile);
        // log 部分
        var bdLog = document.createElement("div");
        bdLog.className = "message-board-log";
        that.dom.appendChild(bdLog);
        that.bdLog = bdLog;
    };

    MessageBoard.prototype.set = function(json) {
        that.bdTitile.innerHTML = "<b>"+json.title+"</b>";
    };

    MessageBoard.prototype.log = function(list) {
        for (var num in list) {
            var data = list[num];
            that.bdLog.innerHTML += "<p>"+data["text"]+"</p><br />";
        }
    }

    window.MessageBoard = MessageBoard;
})(window, document);